<template>
  <u-tabbar
    :value="value6"
    @change="(name) => (value6 = name)"
    :fixed="true"
    :placeholder="true"
    :safeAreaInsetBottom="true"
  >
    <u-tabbar-item
      v-for="(item, index) in routes"
      :key="index"
      :name="index"
      :icon="item.icon"
      :selectedIcon="item.selectedIcon"
      :text="item.text"
      :path="item.path"
      :replace="true"
      @click="goTo(item.path)"
    ></u-tabbar-item>
  </u-tabbar>
</template>

<script>
export default {
  data() {
    return {
      value6: 0,
      routes: [
        {
          path: "index",
          text: "首页",
          icon: "home",
          selectedIcon: "home-fill",
        },
        {
          path: "movie",
          text: "放映厅",
          icon: "photo",
          selectedIcon: "photo-fill",
        },
        {
          path: "live",
          text: "直播",
          icon: "play-right",
        },
        {
          path: "user",
          text: "我的",
          icon: "account",
          selectedIcon: "account-fill",
        },
      ],
    };
  },
  methods: {
    goTo(path) {
      uni.navigateTo({
        url: `/pages/${path}/${path}`,
      });
    },
  },
};
</script>

<style></style>
